import winreg

key = winreg.OpenKey(winreg.HKEY_CURRENT_USER, r'Control Panel\Desktop')
value = winreg.QueryValueEx(key, 'ForegroundLockTimeout')
print(value)
